# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit linux-mod

MY_PV=$(replace_all_version_separators '_')

DESCRIPTION="Broadcom properitary driver for BCM43xx - especially useful for BCM4322"
HOMEPAGE="http://www.broadcom.com/support/802.11/linux_sta.php"
SRC_URI="
    x86?	( http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_32-v${MY_PV}.tar.gz )
    amd64?	( http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_64-v${MY_PV}.tar.gz )"

LICENSE="Broadcom"
KEYWORDS="x86 amd64"
SLOT="0"
IUSE=""
DEPEND=""

MODULE_NAMES="wl(net/wireless:)"
BUILD_TARGETS=" "
CONFIG_CHECK="IEEE80211 IEEE80211_CRYPT_TKIP ~IEEE80211_CRYPT_CCMP ~IEEE80211_CRYPT_WEP"

src_unpack() {
	mkdir ${P}
	cd ${P}
	unpack ${A}
#	epatch "${FILESDIR}/broadcom-drivers-invalid-pointer-${PV}.patch"
}

pkg_setup() {
	linux-mod_pkg_setup

	BUILD_PARAMS="-C ${KV_OUT_DIR} M=${S}"
}

pkg_postinst() {
	linux-mod_pkg_postinst
	ewarn "Please send comments about this ebuild to jabbas@jabbas.pl"
	ewarn "I'm not a developer of this driver, only ebuild maker, so"
	ewarn "please do not ask me for new functionality/bugs/etc. Sorry :-("
}
